$('body').append(`<div id='log' style="max-width: 500px; background-color:#FFFF99">Log:</div>`);

function log(text,type='normal') {
    let html = "";
    switch (type){
        case 'important':
            html = '<p style="background:red">' + text + '</p>';
            break;
        case 'alert':
            html = '<p style="background:green">' + text + '</p>';
            break;
        default:
            html = "<p>" + text + "</p>";
    }
    $('#log').append(html);
     
}